package com.me.jingdongshop.ui.activity;

import android.os.Message;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.me.common.base.BaseActivity;
import com.me.jingdongshop.R;

/**
 * Created by ldl on 2017/5/8.
 * 我的优惠券界面
 */

public class MyCouponActivity extends BaseActivity {
    private TextView tvMyCouponBack;      // 我的优惠券返回
    private TextView tvMyCouponAdd;             // 添加
    private TextView tvMycouponSeptember;          // 9月
    private TextView tvMycouponOctober;           // 10月
    private TextView tvMycouponChristmas;       // 圣诞
    private ImageView ivMycouponSeptemberCheck;   // 9月勾选
    private ImageView ivMycouponOctoberCheck;   // 10月勾选
    private ImageView ivMycouponChristmasCheck;   // 圣诞勾选
    private TextView tvMycouponConfirm;        // 确定

    @Override
    public int getLayoutRes() {
        return R.layout.activity_shopcart_mycoupon;
    }

    @Override
    public void initView() {
        tvMyCouponBack = (TextView) findViewById(R.id.tv_mycoupon_back);
        tvMyCouponAdd = (TextView) findViewById(R.id.tv_mycoupon_add);
        tvMycouponSeptember = (TextView) findViewById(R.id.tv_mycoupon_september);
        tvMycouponOctober = (TextView) findViewById(R.id.tv_mycoupon_october);
        tvMycouponChristmas = (TextView) findViewById(R.id.tv_mycoupon_christmas);
        ivMycouponSeptemberCheck = (ImageView) findViewById(R.id.iv_mycoupon_september_check);
        ivMycouponOctoberCheck = (ImageView) findViewById(R.id.iv_mycoupon_october_check);
        ivMycouponChristmasCheck = (ImageView) findViewById(R.id.iv_mycoupon_christmas_check);
        tvMycouponConfirm = (TextView) findViewById(R.id.tv_mycoupon_confirm);
    }

    @Override
    public void initListener() {
        tvMyCouponBack.setOnClickListener(this);
        tvMyCouponAdd.setOnClickListener(this);
        tvMycouponSeptember.setOnClickListener(this);
        tvMycouponOctober.setOnClickListener(this);
        tvMycouponChristmas.setOnClickListener(this);
        ivMycouponSeptemberCheck.setOnClickListener(this);
        ivMycouponOctoberCheck.setOnClickListener(this);
        ivMycouponChristmasCheck.setOnClickListener(this);
        tvMycouponConfirm.setOnClickListener(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View v, int id) {
        switch (id) {
            case R.id.tv_mycoupon_back:
                finish();
                break;
            case R.id.tv_mycoupon_add:
//                Toast.makeText(getApplicationContext(), "添加", Toast.LENGTH_SHORT).show();
                break;
            case R.id.tv_mycoupon_september:
            case R.id.iv_mycoupon_september_check:
//                Toast.makeText(getApplicationContext(), "9月", Toast.LENGTH_SHORT).show();
                ivMycouponSeptemberCheck.setBackgroundResource(R.drawable.ischeck);
                break;
            case R.id.tv_mycoupon_october:
            case R.id.iv_mycoupon_october_check:
//                Toast.makeText(getApplicationContext(), "10月", Toast.LENGTH_SHORT).show();
                ivMycouponOctoberCheck.setBackgroundResource(R.drawable.ischeck);
                break;
            case R.id.tv_mycoupon_christmas:
            case R.id.iv_mycoupon_christmas_check:
//                Toast.makeText(getApplicationContext(), "圣诞", Toast.LENGTH_SHORT).show();
                ivMycouponChristmasCheck.setBackgroundResource(R.drawable.ischeck);
                break;
            case R.id.tv_mycoupon_confirm:
                Toast.makeText(getApplicationContext(), "确定", Toast.LENGTH_SHORT).show();
                break;
        }
    }

    @Override
    public void onHttpSuccess(int reqType, Message msg) {

    }

    @Override
    public void onHttpError(int reqType, String error) {

    }
}
